<template>
  <div class="app-container">
    <div>
      <search-form :searchFormAction="searchFormAction" @search-submit="searchSubmit" />
    </div>
    <div class="container_style">
      <el-button
        type="primary"
        icon="el-icon-plus"
        size="mini"
      >添加文件</el-button>

      <el-table :data="tableData" border>
        <el-table-column label="文件类型" align="center" >
        <template slot-scope="scope">
          <span>{{ scope.row.fileType }}</span>
        </template>
        </el-table-column>
        <el-table-column label="标题" align="center" prop="title" />
        <el-table-column label="备注" align="center" prop="remarks" />
        <el-table-column label="版本" align="center" prop="version" />
        <el-table-column label="创建时间" align="center" prop="createDate" />
        <el-table-column label="生效时间" align="center" prop="effectiveDate" />
        <el-table-column label="操作" align="center" >
          <template>
            <el-button
              type="text"
              icon="el-icon-delete"
              size="mini"
              style="color: red"
            />
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
  import SearchForm from '../components/search-form'

  export default {
    name: "ManageFile",
    components: {
      SearchForm
    },
    data() {
      return {
        tableData: [
          {
            fileType: '红头文件',
            title: '测试',
            remarks: '测试',
            version: '2.0',
            createDate: '2021-5-31',
            effectiveDate: '2021-5-31'
          },
          {
            fileType: '红头文件',
            title: '测试',
            remarks: '测试',
            version: '2.0',
            createDate: '2021-5-31',
            effectiveDate: '2021-5-31'
          },
          {
            fileType: '红头文件',
            title: '测试',
            remarks: '测试',
            version: '2.0',
            createDate: '2021-5-31',
            effectiveDate: '2021-5-31'
          }
        ],
        searchFormAction: [
          {
            label: '标题',
            prop: 'title',
            placeholder: '',
            i18n: 'manage-file.title',
            type: 'input',
            dictData: [],
            l_weight: '50px',
            span: 5
          },
          {
            label: '创建时间',
            prop: 'createDate',
            placeholder: '',
            i18n: 'manage-file.createDate',
            type: 'input',
            dictData: [],
            l_weight: '80px',
            span: 5
          }
        ]
      }
    },
    methods: {
      searchSubmit() {
        console.log('测试')
      }
    }
  }
</script>

<style  scoped>

</style>
